package com.qiudaozhang.loveblog.service.impl;

import com.qiudaozhang.loveblog.entity.User;
import com.qiudaozhang.loveblog.repository.UserRepository;
import com.qiudaozhang.loveblog.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * @author 邱道长
 * 2019/11/13
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserRepository ur;

    @Override
    public void reg(User user) {
        user.setCreated(LocalDateTime.now());// 注册时间为当前时间
        ur.save(user);
    }
}
